﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WhutDoomCheck.Server.Entities
{
    public class Student
    {
        [Key, Required]
        public string Sno { get; set; } = null!;

        [Required]
        public int Grade { get; set; }

        [Required]
        public string Name { get; set; } = null!;

        /// <summary>
        /// 民族
        /// </summary>
        [Required]
        public string Ethnic { get; set; } = null!;

        /// <summary>
        /// 学院
        /// </summary>
        [Required]
        public string School { get; set; } = null!;

        [Required]
        public string Gender { get; set; } = null!; 

        /// <summary>
        /// 培养方式
        /// </summary>
        [Required]
        public string CultureMethod { get; set; } = null!;  

        /// <summary>
        /// 专业
        /// </summary>
        [Required]
        public string Major { get; set; } = null!;

        /// <summary>
        /// 联系方式
        /// </summary>
        [Required]
        public string Contact { get;set; } = null!;

        public string CounsellorId { get; set; } = null!;

        /// <summary>
        /// 辅导员
        /// </summary>
        [ForeignKey(nameof(CounsellorId))]
        public Counsellor Counsellor { get; set; } = null!;

        /// <summary>
        /// 导师姓名
        /// </summary>
        public string? GuideName { get; set; } 

        /// <summary>
        /// 导师联系方式
        /// </summary>
        public string? GuideContact { get; set; } 

        /// <summary>
        /// 是否校内住宿
        /// </summary>
        public bool IsInSchool { get; set; }

        /// <summary>
        /// 宿舍ID
        /// </summary>
        public int? DoomId { get; set; }

        [ForeignKey(nameof(DoomId))]
        public Doom? Doom { get; set; }

        /// <summary>
        /// 几号床
        /// </summary>
        public int? BedNum { get; set; }

        /// <summary>
        /// 校外住宿地址
        /// </summary>
        public string? Address { get; set; }

        /// <summary>
        /// 与学生关联的Record
        /// </summary>
        public IList<Record> Records { get; set; } = null!;

    }
}
